<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <script src="../vue.js"></script>
  </head>

  <body>
    <div id="app">
      <p>n的值是： <span v-text="n"></span></p>
      <p>n被放大的值是： <span v-big="n"></span></p>
      <button @click="n++">n+1</button>
    </div>
    <script>
      const vm = new Vue({
        el: "#app",
        data() {
          return {
            n: 1,
          };
        },
        directives: {
          big(a, b) {
            console.log(a, b);
            a.innerText = b.value * 10;
          },
        },
      });
    </script>
  </body>
</html>
